package com.tm.media.login.controller;

import com.tm.media.utils.utils.PageUtil;
import com.tm.media.login.annotation.SysAnnotation;
import com.tm.media.login.enums.OperationTypeEnum;
import com.tm.media.login.service.ApUserIdentityService;
import com.tm.media.model.entity.ApUserIdentity;
import com.tm.media.utils.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("api/v1/admin/auth")
public class ApUserIdentityController {
    @Autowired
    private ApUserIdentityService apUserIdentityService;

    /**
     * 查询
     * @param pageUtil
     * @return
     */
    @PostMapping("list")
    public Result list(@RequestBody PageUtil pageUtil){
        return apUserIdentityService.selectList(pageUtil);
    }

    /**
     * 通过
     * @param apUserIdentity
     * @return
     */
    @PostMapping("authPass")
    @SysAnnotation(logType = OperationTypeEnum.UPDATE,logModule = "状态修改",description = "通过")
    public Result authPass(@RequestBody ApUserIdentity apUserIdentity){
        return apUserIdentityService.authPass(apUserIdentity);
    }
   @PostMapping("authFail")
   public Result authFail(@RequestBody ApUserIdentity apUserIdentity){
       return apUserIdentityService.authFail(apUserIdentity);
   }
}
